using Vin.Tool.Attributes;

namespace Vin.Extension.Framework.Upload.Tencent.Options;

[Option("VinUpload:Cos")]
public class CosOption
{
    /// <summary>
    /// 地域 设置默认的地域, COS 地域的简称请参照 https://cloud.tencent.com/document/product/436/6224
    /// </summary>
    public string? Region { get; set; } = "ap-nanjing";

    /// <summary>
    /// SecretId 云 API 密钥 SecretId, 获取 API 密钥请参照 https://console.cloud.tencent.com/cam/capi
    /// </summary>
    public string? SecretId { get; set; }

    /// <summary>
    /// SecretKey 云 API 密钥 SecretKey, 获取 API 密钥请参照 https://console.cloud.tencent.com/cam/capi
    /// </summary>
    public string? SecretKey { get; set; }

    /// <summary>
    /// 每次请求签名有效时长，单位为秒
    /// </summary>
    public long DurationSecond { get; set; } = 600;

    /// <summary>
    /// 存储桶名称，此处填入格式必须为 bucketname-APPID, 其中 APPID 获取参考 https://console.cloud.tencent.com/developer
    /// </summary>
    public string? Bucket { get; set; }

    /// <summary>
    /// 直接下载
    /// </summary>
    public bool Download { get; set; } = false;

    public bool IsValidate => !string.IsNullOrEmpty(Region) &&
                              !string.IsNullOrEmpty(SecretId) &&
                              !string.IsNullOrEmpty(SecretKey) &&
                              !string.IsNullOrEmpty(Bucket);
}